//
// Created by bill3000 on 2/9/21.
//

#ifndef INTELLI_MACROS_HPP
#define INTELLI_MACROS_HPP

enum MessageDirectionMacros {
    MESSAGE_DIRECTION_FROM_WEB = 100,
    MESSAGE_DIRECTION_TO_WEB = 200,
    MESSAGE_DIRECTION_UI_THREAD_TO_SORTING_THREAD = 300,
    MESSAGE_DIRECTION_SORTING_THREAD_TO_MECH = 400
};

enum State_Macro {
    STATE_INIT = 0,
    STATE_READY = 1,
    STATE_MOVING_IMAGE_PREVIEW_INIT = 2,
    STATE_MOVING_IMAGE_PREVIEW = 3,
    STATE_SIZE_AUTO_LEARNING_SAL = 4,
    STATE_SAL_COMPLETE = 5,
    STATE_SIZE_SEMI_LEARNING_SSL = 6,
    STATE_SSL_COMPLETE = 7,
    STATE_SUGAR_ANNOTATION = 8,
    STATE_SA_COMPLETE = 9,
    STATE_SUGAR_LEARNING = 10,
    STATE_RUNNING_SORTING = 11,
    STATE_PAUSE_SORTING = 12,
    STATE_MANAGE_HISTORY_DATA = 13,
    STATE_MOVING_IMAGE_PREVIEW_END = 14,
    STATE_LEARNING_SAL_STOPPED = 15,
    STATE_LEARNING_SSL_STOPPED = 16
};

enum Event_Macro {
    EVENT_GET_CAM_PARAM = 0x00010100,
    EVENT_PREVIEW_STILL_IMAGE = 0x00010200,
    EVENT_PREVIEW_MOVING_IMAGE = 0x00010300,
    EVENT_MODIFY_CAM_PARAM = 0x00010400,

    EVENT_START_SIZE_AUTO = 0x00020100,
    EVENT_GET_SIZE_AUTO_PROCESS_IMAGE = 0x00020200,
    EVENT_COMPLETE_SIZE_AUTO = 0x00020300,
    EVENT_VIEW_SIZE_SAMPLE = 0x00020400,
    EVENT_SAVE_SIZE_LEARNED = 0x00020500,
    EVENT_START_SIZE_SEMI = 0x00010600,
    EVENT_COMPLETE_SIZE_SEMI = 0x00020700,

    EVENT_START_SUGAR_ANN = 0x00030100,
    EVENT_SUGAR_NEXT_PREVIOUS_VALUE = 0x00030200,
    EVENT_STOP_SUGAR_ANN = 0x00030300,
    EVENT_SAVE_SUGAR_ANN = 0x00030400,
    EVENT_START_SUGAR_LEARNING = 0x00030500,
    EVENT_SUGAR_QUERY_LEARNING_PROGRESS = 0x00030600,
    EVENT_CANCEL_SUGAR_LEARNING = 0x00030700,
    EVENT_SAVE_SUGAR_LEARNED = 0x00030800,

    EVENT_LOAD_SIZE_MODEL = 0x00040100,
    EVENT_LOAD_SUGAR_MODEL = 0x00040200,
    EVENT_START_SORTING = 0x00040300,
    EVENT_VIEW_SORTING_PRECESS_IMAGE = 0x00040400,
    EVENT_STOP_SORTING = 0x00040500,
    EVENT_VIEW_SORTING_STATISTICS = 0x00040600,

    EVENT_GET_HISTORY_SORTED_LIST = 0x00050100,
    EVENT_VIEW_HISTORY_STATISTICS = 0x00050200,
    EVENT_DELETE_HISTORY = 0x00050300,

    //EVENT_TIMER_TIMEOUT = 0x00100100,
    EVENT_GO_TO_NEXT_STATE_DIRECTLY = 0x00100200,
    EVENT_ANY = 0x00100300,
    EVENT_LEARNING_SAL_COMPLETED = 0x00100400,
    EVENT_LEARNING_SSL_COMPLETED = 0x00100500
};

enum Action_Macro {
    ACTION_NONE = 0,

    ACTION_OPEN_CAM = 1,
    ACTION_START_CONVEYOR = 2,
    ACTION_STOP_CONVEYOR = 3,

    ACTION_GET_CAM_PARAM = 4,
    ACTION_PREVIEW_STILL_IMAGE = 5,
    ACTION_PREVIEW_MOVING_IMAGE = 6,
    ACTION_MODIFY_CAM_PARAM = 8,

    ACTION_START_SIZE_AUTO_LEARNING = 9,
    ACTION_GET_SIZE_AUTO_PROGRESS_IMAGE = 10,
    ACTION_STOP_SIZE_AUTO_LEARNING = 11,
    ACTION_VIEW_SIZE_LEARNING_SAMPLE = 12,
    ACTION_SAVE_SIZE_LEARNING_MODEL = 13,
    ACTION_START_SEMI_SIZE_LEARNING = 14,
    ACTION_STOP_SEMI_SIZE_LEARNING = 15,

    ACTION_START_SUGAR_ANNOTATION = 16,
    ACTION_GET_NEXT_NIR_IMAGE_PREVIOUS_SUGAR = 17,
    ACTION_STOP_SUGAR_ANNOTATION = 18,
    ACTION_SAVE_SUGAR_ANNOTATION = 19,
    ACTION_START_SUGAR_LEARNING = 20,
    ACTION_QUERY_SUGAR_LEARNING_PROGRESS = 21,
    ACTION_SAVE_SUGAR_LEARNED_MODEL = 22,
    ACTION_CANCEL_SUGAR_LEARNING = 23,

    ACTION_LOAD_SIZE_MODEL = 24,
    ACTION_LOAD_SUGAR_MODEL = 25,
    ACTION_START_SORTING = 26,
    ACTION_VIEW_SORTING_PROCESS_IMAGE = 27,
    ACTION_VIEW_SORTING_STATISTICS = 28,
    ACTION_PAUSE_SORTING = 29,

    ACTION_GET_HISTORY_SORTING_DATA = 30,
    ACTION_VIEW_HISTORY_STATISTICS = 31,
    ACTION_DELETE_HISTORY_DATA = 32,

    ACTION_PUT_EVENT_BACK_TO_QUEUE = 33,

    ACTION_LEARNING_SAL_RETURN_LEARNED_RESULT_TO_UI = 34,
    ACTION_LEARNING_SSL_RETURN_LEARNED_RESULT_TO_UI = 35
};

#endif //INTELLI_MACROS_HPP
